{% comment %}
/* Copyright 2009 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{% endcomment %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta name="generator" content="Cruise Control for App Engine {{cc_version}}" />
    {% if blog.keywords or post.keywords or page.keywords %}
    <meta
      name="keywords"
      content="{% filter escape %}{% firstof post.keywords page.keywords blog.keywords %}{% endfilter %}" />
    {% endif %}
    {% if blog.description or post.description or page.description %}
    <meta
      name="description"
      content="{% filter escape %}{% firstof post.description page.description blog.description %}{% endfilter %}" />
    {% endif %}
    {% if noindex or noarchive or nofollow or nosnippet or noodp %}
    <meta
      name="robots"
      content="{% if noindex %}noindex,{% endif %}{%if nofollow %}nofollow,{% endif %}{% if nosnippet %}nosnippet,{% endif %}{% if noodp %}noodp{% endif %}" />
    {% endif %}
    {% if blog.canonical or post.canonical or page.canonical %}
    <link rel="canonical"
      href="{% filter escape %}{% firstof post.canonical page.canonical blog.canonical %}{% endfilter %}"
    />
    {% endif %}
    <link
      rel="stylesheet"
      type="text/css"
      href="http://yui.yahooapis.com/2.7.0/build/reset-fonts/reset-fonts.css"
    />
    <link
      rel="stylesheet"
      type="text/css"
      href="/templates/{{blog.template}}/css/style.css"
    />
    <link 
      rel="icon" 
      href="favicon.ico"/>
    <link rel="alternate" 
      type="application/rss+xml" 
      title="RSS" 
      href="{% if blog.feed_path %}{{blog.feed_path}}{% else %}/sitemap.rss{% endif %}">
    <title>
      {{post.title}} {{page.title}}
        {% if post or page %} - {% endif %}
      {{blog.name}} - {{blog.tagline}}
    </title>
    {% if blog.google_analytics_id %}
	<script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '{{blog.google_analytics_id}}']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
      })();
    </script>
    {% endif %}
  </head>
  <body>

    {% if blog.enable_comments %}
    <div id="cc-act">
      {% if user %}
      {{user.gia.email}} |
      {% if is_admin %}
      <a href="/admin/post">Admin</a> |
      {% endif %}
      <a href="{{logout_url}}">Logout</a>
      {% else %}
      <a href="{{login_url}}">Login</a>
      {% endif %}
    </div>
    {% endif %}
    
    <div>
      <a href="/">
      {% if blog.logo_path %}
      <img src="/images/{{blog.logo_path}}">
      {% else %}
      {{blog.name|title}}
      {% endif %}
      </a>
      <div>{{blog.tagline}}</div>
    </div>
    {% if blog.google_cse_box %}
      <div id="search-box">
          {{blog.google_cse_box}}
      </div>
    {% endif %}

    <ul>Pages:
      <li><a href="/">{{blog.button_name}}</a></li>
      {% for page in published_pages %}
      <li><a href="/{{page.path}}">{{page.button_name}}</a></li>
      {% endfor %}
    </ul>

    {% block content %}
      &nbsp;
    {% endblock %}

    <ul>{{blog.link_title}}
    {% for link in blog_links %}
      <li>
        <a href="{{link.url}}" {% if link.nofollow %} rel="nofollow"{% endif %}>
          {{link.anchor}}
        </a>
      </li>
    {% endfor %}
    </ul>
  </body>
</html>